wayland: don't leave root window values uninitialised
authorRob Bradford <rob@linux.intel.com>
Tue, 9 Apr 2013 10:49:42 +0000 (11:49 +0100)
committerRob Bradford <rob@linux.intel.com>
Tue, 9 Apr 2013 11:52:16 +0000 (12:52 +0100)
Under Wayland we don't know the absolute position of the device but there are
some API calls that expect to get an root window position. Previously we were
not assigning any value to these out parameters potentially leaving the values
undefined.

This change returns the current surface relative position of the device.

gdk/wayland/gdkdevice-wayland.c

index 8cf8447204c7c346d373669d5c5acbab9459dc87..c258be3316ff3e54fcf031cf8ea9d00e77dfd65f 100644 (file)
@@ -255,13 +255,11 @@ gdk_wayland_device_query_state (GdkDevice        *device,
     *root_window = gdk_screen_get_root_window (default_screen);
   if (child_window)
     *child_window = wd->pointer_focus;
-  /* Do something clever for relative here */
-#if 0
+  /* TODO: Do something clever for relative here */
   if (root_x)
-    *root_x = wd->x;
+    *root_x = wd->surface_x;
   if (root_y)
-    *root_y = wd->y;
-#endif
+    *root_y = wd->surface_y;
   if (win_x)
     *win_x = wd->surface_x;
   if (win_y)